// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import VueRouter from 'vue-router';
// import VueResource from 'vue-resource';
import App from './App';
import order from '@/components/order/order';
import week from '@/components/week/week';
import month from '@/components/month/month';
import vActionSheet from '@/components/actionSheet/actionSheet';

import group from '@/components/group/group';
import input from '@/components/group/input/input';
import radio from '@/components/group/radio/radio';

Vue.use(VueRouter);
// Vue.use(VueResource);

const routes = [
  {
    path: '/',
    redirect: '/order'
  },
  {
    path: '/order',
    component: order
  },
  {
    path: '/week',
    component: week
  },
  {
    path: '/month',
    component: month
  },
  {
    path: '/order/actionSheet',
    component: vActionSheet
  },
  {
    path: '/group',
    component: group
  },
  {
    path: '/group/input',
    component: input
  },
  {
    path: '/group/radio',
    component: radio
  }
];

const router = new VueRouter({
  linkActiveClass: 'active', // 点击时添加 '.active'
  routes  // 相当于 routes: routes;引入前面配置的routes变量
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router, // 相当于 router: router； 引入前面VueRouter实例
  render: h => h(App)
});

